package BusLib;

import java.io.Serializable;
import java.util.*;


public class Link implements Serializable {
    int startStationId_;
    int endStationId_;
    int lenght_;
    int time_;
    ArrayList<Street> streets_;

    /*
     * Constructori.
     */
    public Link(){
       startStationId_= 0;
       endStationId_=0;
       lenght_=0;
       streets_=new ArrayList<Street>();
    }


    public Link(int startStationId,int endStationId,int lenght, int time){
       startStationId_= startStationId;
       endStationId_=endStationId;
       lenght_=lenght;
       time_ = time;
       streets_=new ArrayList<Street>();

    }

    /*
     * Metode.
     */
    public int StartStationId(){ return startStationId_;}
    public void SetStartStationId( int startStationId ){ startStationId_ = startStationId;}
    public int EndStationId(){ return endStationId_;}
    public void SetEndStationId( int endStationId ){ endStationId_ = endStationId;}
    public int Lenght(){ return lenght_;}
    public void SetLenght( int lenght ){ lenght_ = lenght;}
    public int Time(){return time_;}
    public void SetTime(int time){time_=time;}


      // Metode ce acceseaza lista de strazi.
    public List<Street> Streets() { return streets_; }
    // Se adauga o strada in ArrayList-ul streets_.
    public void AddStreet(Street street) { streets_.add(street);  }
    // Se verifica daca o strada apartine listei de strazi
    public void ContainsStreet(Street street) { streets_.contains(street); }
    // Se sterge o strada din ArrayList-ul streets_.
    public void DeleteStreet(Street street) { streets_.remove(street); }
    // Se sterge lista de strazi
    public void ClearStreets(){ streets_.clear(); }


}
